package com.meals.system.dao;

import com.meals.system.entity.StockNumDTO;
import com.meals.system.entity.WhitesMealGoods;
import com.meals.system.util.PageQueryUtil;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Description:
 * Parm:
 * return:
 * Author: Chen
 * Date: 2021/12/5
 */
@Mapper
public interface WhitesMealGoodsMapper {

    List<WhitesMealGoods> selectByPrimaryKeys(List<Long> goodsId);

    /**
     * 物品列表
     * @param pageUtil
     * @return
     */
    List<WhitesMealGoods> findWhitesMealGoodsList(PageQueryUtil pageUtil);

    List<WhitesMealGoods> findWhitesMealGoodsListBySearch(PageQueryUtil pageUtil);

    int getTotalWhitesMealGoods(PageQueryUtil pageUtil);

    int getTotalWhitesMealGoodsBySearch(PageQueryUtil pageUtil);

    WhitesMealGoods selectByPrimaryKey(Long goodsId);

    /**
     * 根据sellerId 和 goodsName 搜索goods_info表对应的good
     * @param goodsName
     * @param sellerId
     * @return
     */
    WhitesMealGoods selectBySellerIdAndName(@Param("goodsName") String goodsName, @Param("sellerId") Long sellerId);

    int deleteByPrimaryKey(Long goodsId);

    int insert(WhitesMealGoods record);

    int insertSelective(WhitesMealGoods record);

    int batchInsert(@Param("whitesMealGoods") List<WhitesMealGoods> whitesMealGoods);





    int updateByPrimaryKey(WhitesMealGoods record);

    int updateByPrimaryKeySelective(WhitesMealGoods record);

    /**
     * 没有 update sellerId
     * @param record
     * @return
     */
    int updateByPrimaryKeyWithBLOBs(WhitesMealGoods record);

    int updateStockNum(@Param("stockNumDTOS")List<StockNumDTO> stockNumDTOS);

    /**
     * orderId
     * @param ordersIds
     * @param sellerStatus
     * @return
     */
    int batchUpdateSellStatus(@Param("orderIds") Long[] ordersIds, @Param("sellerStatus") int sellerStatus);

}
